//
//  VIPSignalManager.h
//  TTProduct
//
//  Created by My mac on 2019/8/1.
//  Copyright © 2019年 TTProduct. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "VIPSignalingProtocol.h"
#import "VIPSignalingModel.h"
#import "VIPMessage.h"
#import "VIPRoomModel.h"

@class VIPSignalingModel;

NS_ASSUME_NONNULL_BEGIN

typedef void (^SignaingDidBanned)(void); // 被T

// 信令
typedef void (^SignaingMessageResponse)(NSString* account, VIPSignalingModel *signalingModel); //接收消息
typedef void (^SignalingLogout)(VIPMessage *message);//信令与服务器失去连接
typedef void (^SignalingLoginSuccess)(uint32_t uid);//信令登录成功
typedef void (^SignalingLoginFailed)(AgoraEcode ecode);//信令登录失败
typedef void (^SignalingTokenDidFailure)(void); // token已经失效

@interface VIPSignalManager : NSObject

@property (nonatomic, copy) SignaingDidBanned signaingDidBanned; // 被T
@property (nonatomic, copy) SignalingLogout signalingLogout; // 信令断开连接
@property (nonatomic, copy) SignaingMessageResponse signaingResponse; // 接受信息
@property (copy, nonatomic) SignalingTokenDidFailure tokenDidFailure; // token已经失效

+ (instancetype)shareManager;

- (void)bindingRoomInfo:(VIPRoomModel *)room;
- (void)initializeSignalingCompletion:(nullable VIPCompletionHandler)completion;
- (void)leaveRoom; // 退出房间 并且 退出信令
// 退出房间, 不退出信令
- (void)leaveRoomCompletion:(nullable VIPCompletionHandler)completion;
- (void)logoutSignaling; // 退出信令

// 发送信令
- (void)sendMessageChannelMsg:(NSString*)msg;
- (void)sendMessageChannelMsg:(NSString*)msg completion:(nullable VIPCompletionHandler)completion;

@end

NS_ASSUME_NONNULL_END
